class Solution(object):
    def singleNumber(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        nums_len = len(nums)
        num = nums[0]
        i = 1
        while i < nums_len:
            num ^= nums[i]
            i += 1
        return num
